package com.yootk.di.config;

import java.util.Objects;

/**
 * 定义消息数据的配置类
 */
public class MessageConfig {
    private String host;
    private int port;
    private boolean enable;

    public String getHost() {
        return host;
    }

    public void setHost(String host) {
        this.host = host;
    }

    public int getPort() {
        return port;
    }

    public void setPort(int port) {
        this.port = port;
    }

    public boolean isEnable() {
        return enable;
    }

    public void setEnable(boolean enable) {
        this.enable = enable;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        MessageConfig that = (MessageConfig) o;
        return port == that.port && enable == that.enable && host.equals(that.host);
    }

    @Override
    public int hashCode() {
        return Objects.hash(host, port, enable);
    }

    @Override
    public String toString() {
        return "【MessageConfig - " + super.hashCode() + "】主机：" + this.host + "、端口：" + this.port + "、状态：" + this.enable;
    }
}
